home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / appact_1 / frmappac.frm (.txt) < prev    next >
Visual Basic Form  |  1998-07-02  |  2KB  |  39 lines

  1. VERSION 5.00
  2. Begin VB.Form frmAppActivate 
  3.    AutoRedraw      =   -1  'True
  4.    Caption         =   "Topic :"
  5.    ClientHeight    =   2940
  6.    ClientLeft      =   4560
  7.    ClientTop       =   1635
  8.    ClientWidth     =   4965
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   196
  11.    ScaleMode       =   3  'Pixel
  12.    ScaleWidth      =   331
  13. Attribute VB_Name = "frmAppActivate"
  14. Attribute VB_GlobalNameSpace = False
  15. Attribute VB_Creatable = False
  16. Attribute VB_PredeclaredId = True
  17. Attribute VB_Exposed = False
  18.   Option Explicit
  19.     ' used to determine whether or not this demo is running in the IDE
  20.   Private Declare Function GetClassName& Lib "user32" Alias "GetClassNameA" (ByVal hWnd&, _
  21.                                                                 ByVal lpClassName$, ByVal nMaxCount&)
  22. Private Sub Form_Load()
  23.   ' position the form
  24.   Move (Screen.Width \ 2) - (Width \ 2), (Screen.Height \ 3) - (Height \ 3)
  25.   ' check to see of we are running in the IDE
  26.   If RunningInIde Then _
  27.           MsgBox "This demo will NOT work properly when run in the IDE." & vbCrLf & _
  28.           vbCrLf & "See the ""IMPORTANT NOTE"" in the General Declarations" & vbCrLf & _
  29.           "section of the .bas module code file for more info.", vbExclamation, "App Activate Demo"
  30. End Sub
  31. Private Function RunningInIde() As Boolean
  32.   Dim sClassName$, nStrLen&
  33.   ' check to see where we're running in the IDE
  34.   sClassName = String$(260, vbNullChar)
  35.   nStrLen = GetClassName(hWnd, sClassName, Len(sClassName))
  36.   If nStrLen Then sClassName = Left$(sClassName, nStrLen)
  37.   If sClassName = "ThunderForm" Then RunningInIde = True
  38. End Function
  39.